/** Handled Result definition.
 *
 *  This file define the function return value which show what happen in those functions.
 *
 *  @author : huicong
 *  @date : 2008-10-26
 *
 */

#ifndef _HANDLED_RESULT_H
#define _HANDLED_RESULT_H

/** Handled result is only an integer. */
typedef int HRESULT; 

/** Handled result bit define.
 *
 *  |-----------------------------------|
 *  |b|0|1234567890123456789012345678901|
 *  |-----------------------------------|
 *  |0|O|                               |
 *  |-----------------------------------|
 *  |1|E|                               |
 *  |-----------------------------------|
 *
 */

/** OK : Nothing wrong */
#define H_OK 0

/** ERROR : Unknow error */
#define H_E_UNKNOW -1

/** ERROR : The MPI receiver buffer overflow */
#define H_E_MPI_READER_BUFFER_OVERFLOW -2
/** ERROR : The MPI receiver head info error */
#define H_E_MPI_READER_HEAD_ERROR -3
/** WARNNING : The MPI receiver has no more buffer byte to read. */
#define H_W_MPI_READER_BUFFER_LACK 1

/** ERROR : The MPI sender buffer less than writer data */
#define H_E_MPI_WRITER_BUFFER_LACK 2

/** new pointer failed */
#define H_E_MEMORY_REQUIR_FAILED -4

/** No frame init task */
#define H_E_FRAME_INI_TASK_NOT_FOUND -5

/** No frame final task */
#define H_E_FRAME_FIN_TASK_NOT_FOUND -6

/** Can not find next task */
#define H_E_NEXT_TASK_NOT_FOUND -7

#endif //#ifndef _HANDLED_RESULT_H